public class Test {
    public static void main9(String[] args) {
        int a = 10;
        System.out.println(true);
        System.out.println(false);
    }

    public static void main1(String[] args) {
       int a =10;
        System.out.println(a);
        int b;
        b = 2;
        System.out.println(b);
//        注意在java中不允许使用未初始化的局部变量
        System.out.println(Integer.MIN_VALUE);
        System.out.println(Integer.MAX_VALUE);
//        int的包装类型：Integer,int的plus版本
        Integer aa = 10;
        System.out.println(aa);
    }

    public static void main2(String[] args) {
        long a = 5L;
        System.out.println(a);
        System.out.println(Long.MIN_VALUE);
        System.out.println(Long.MAX_VALUE);
    }

    public static void main3(String[] args) {
        short sh = 32767;
        System.out.println(sh);
        System.out.println(Short.MIN_VALUE);
        System.out.println(Short.MAX_VALUE);
    }

    public static void main4(String[] args) {
       byte a =125;
        System.out.println(a);
        System.out.println(Byte.MAX_VALUE);
        System.out.println(Byte.MIN_VALUE);
    }

    public static void main5(String[] args) {
        float a = 23.6f;
        System.out.println(a);

        float f =1;
        int b = 2;
      System.out.println(f / b);//输出0

        double d = 1.1;
        System.out.println(d * d);
    }

    public static void main6(String[] args) {
        char ch = '牛';
        System.out.println(ch);
        Character a = 'b';//unicode字符集
    }

    public static void main7(String[] args) {
        //在java中，boolean只有两个值，true或者是false
        //与c语言不同，没有所谓的0是假，非0为真
        boolean boo = true;
        System.out.println(boo);
        //boolean没有明确的大小
    }

    public static void main8(String[] args) {
        int a = 10;
        long b = 10L;
        int c = (int)(a+b);  //4个字节提示为8个字节
        a = (int)b;//不允许将 8个字节 给4个字节
        b = a;
         /*
        整型提升
            byte b1 = 10;
            byte b2 = 20;
            //< 4个字节的  数据 会提升为4个字节再运算
            byte b3 = b1+b2;

            short s1 = 10;
            short s2 = 20;
            short s3 = s1+s2;
        */
    }

    public static void main(String[] args) {
         //str 属于引用变量->就是这个变量里面存的是地址
        //“hello" 没有所谓的\0就是字符串的结尾这样的说法
        String str1 = "hello";
        System.out.println(str1);
        String str2 = "world";
        System.out.println(str2);
        //拼接
        String str3 = str1+str2;
        System.out.println(str3);
        int a = 10;
        System.out.println("a == " + a );//java中的字符串和其它数据类型进行+号操作就是拼接
        System.out.println(a+"== a");
        int b = 20;
        System.out.println("a+b= "+(a+b));//a+b==1020,可以加上括号先计算a+b
        System.out.println(a+b + "== a+b");//30==a+b 从左到右计算
    }

    public static void main10(String[] args) {
        String str = "123";
        int val = Integer.parseInt(str);
        System.out.println(val+1);


        int a = 123;
        String str2 = String.valueOf(a);
        System.out.println(str2);

        String str3 = a+"";
        System.out.println(str3);

        String str4 = Integer.toString(a);
        System.out.println(str4);
    }

    public static void main11(String[] args) {
        int a = 1;
        a += 2;//a = a + 2
        System.out.println(a);

        long b = 10L;
        int i = 3;
        i += b;  //-> i = i + b;
        System.out.println(i);


        byte b1 = 1;
        byte b2 = 127;
        b2 += b1;
        System.out.println(b2);//截断的
    }

    public static void main12(String[] args) {
        int a = 10;
        //int b = a++;
        a = a++;
        System.out.println(a);
    }

    public static void main13(String[] args) {
        int a = 10;
        int b = 20;
        // 注意：在Java中 = 表示赋值，要与数学中的含义区分
        // 在Java中 == 表示相等
        System.out.println(a == b); // false
        System.out.println(a != b); // true
        System.out.println(a < b); // true
        System.out.println(a > b); // false
        System.out.println(a <= b); // true
        System.out.println(a >= b); // false
    }
    }


